import {useState} from 'react'
import {DatePicker} from 'antd'
import style from './css/HotRank.module.scss'
interface Props {
    sendDate(dateString: any): unknown;
    children?: any;
}
function HotRank(props: Props) {
    const { RangePicker } = DatePicker;
    const [date, setDate] = useState(null);
    const onDateChange = (value:any,dateString:any) => {
      setDate(value); // 设置日期状态
      props.sendDate(dateString)
    };
    return ( 
        <>
            <div className={style.sort}>
                <div className={style.sortname}>
                    {props.children[0]}
                    <RangePicker
                        value={date}
                        onChange={onDateChange}
                        placeholder={['开始日期', '结束日期']}
                    >  
                    </RangePicker>
                </div>
                {props.children[1]}
            </div>
        </>
     );
}

export default HotRank;